package Interfaces_EquipAB_Factory;

public class Factory {

    //    注入对象
    EquipmentA equipmentA = new EquipmentA();

    //    生成getter、setter方法
    public EquipmentA getEquipmentA() {
        return equipmentA;
    }

// 设置设备A
    public void setEquipmentA(EquipmentA equipmentA) {
        this.equipmentA = equipmentA;
    }

    public void work() {
        // 打印开始调用设备A的提示信息
        System.out.println("这是工厂类，准备调用设备A开始生产...");
        // 调用设备A的work方法
        this.equipmentA.work();
    }
}
